﻿<UserControl x:Class="YouTubePlaylist.Views.TrackInputCtrl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input" 
    xmlns:ContentControls="clr-namespace:Radovici.Ctrls.ContentControls;assembly=RadoviciCtrls" 
    xmlns:SharedLibrary="clr-namespace:Radovici.SharedLibrary;assembly=RadoviciSharedLibrary">
    <UserControl.Resources>
        <SharedLibrary:BooleanToVisibilityConverter x:Key="ToVisibilityConverter" />
        <Style x:Name="HeaderStyle" TargetType="TextBlock">
            <Setter Property="FontSize" Value="16"/>
        </Style>
        <Style x:Name="NoteStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="LightSalmon"/>
            <Setter Property="FontSize" Value="10"/>
        </Style>
    </UserControl.Resources>
    <Grid ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition Height="25"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0" Margin="2">
            <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource HeaderStyle}" Text="Please enter the track's info." TextWrapping="Wrap"/>
            <ContentControls:Dropable VerticalAlignment="Center"  HorizontalAlignment="Right" SourceDataContext="{Binding Track}" Visibility="{Binding CanAddTrack, Converter={StaticResource ToVisibilityConverter}}">
                <Image Source="/YouTubePlaylist;component/Views/Resources/48/movie-track-add-48x48.png"/>
            </ContentControls:Dropable>
        </Grid>        
        <Border Grid.Row="1" BorderBrush="Black" CornerRadius="10" BorderThickness="2" Margin="2" Padding="8">
            <StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Width="75" Text="Artist:" VerticalAlignment="Center" Margin="0,0,2,0" />
                    <Controls:AutoCompleteBox x:Name="ArtistCtrl" Text="{Binding Track.Artist, Mode=TwoWay}" Width="300" Margin="2,0,0,0" KeyUp="ArtistKeyUp"
                                      FilterMode="Contains" ItemsSource="{Binding AutoComplete.Artists}" MaxDropDownHeight="300"/>
                </StackPanel>
                <TextBlock Width="400" TextWrapping="Wrap" Style="{StaticResource NoteStyle}" VerticalAlignment="Center"
                   Text="The artist is the name of the singer, songwriter, or band (i.e., John Lennon, Beatles, etc.,)." />
            </StackPanel>
        </Border>

        <Border Grid.Row="2" BorderBrush="Black" CornerRadius="10" BorderThickness="2" Margin="2" Padding="8">
            <StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Width="75" Text="Title:" VerticalAlignment="Center" Margin="0,0,2,0"/>
                    <Controls:AutoCompleteBox x:Name="TrackCtrl" Text="{Binding Track.Name, Mode=TwoWay}" Width="300" Margin="2,0,0,0" KeyUp="TrackKeyUp"
                                      FilterMode="Contains" ItemsSource="{Binding AutoComplete.ArtistTracks}" MaxDropDownHeight="300"/>
                </StackPanel>
                <TextBlock Width="400" TextWrapping="Wrap" Style="{StaticResource NoteStyle}" VerticalAlignment="Center"
                   Text="The title is the song's name (i.e., Strawberry Fields Forever)." />
            </StackPanel>
        </Border>

        <Border Grid.Row="3" BorderBrush="Black" CornerRadius="10" BorderThickness="2" Margin="2" Padding="8">
            <StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Width="75" Text="Video Type:" VerticalAlignment="Center" Margin="0,0,2,0"/>
                    <Controls:AutoCompleteBox Width="300" Margin="2,0,0,0" FilterMode="Contains" ItemsSource="{Binding AutoComplete.Categories}"/>
                </StackPanel>
                <TextBlock Width="400" TextWrapping="Wrap" Style="{StaticResource NoteStyle}" VerticalAlignment="Center"
                   Text="The video type is an additional and optional description of the video. Some video types are 'karaoke', 'live', 'cover', etc. No category is the default." />
            </StackPanel>
        </Border>

        <Grid Grid.Row="4" Margin="0,2,0,2">
            <ProgressBar IsIndeterminate="{Binding AutoComplete.IsCalculating}"/>
            <TextBlock Text="{Binding AutoComplete.Status}" VerticalAlignment="Center" Margin="2,0,0,0"/>
        </Grid>
    </Grid>
</UserControl>
